﻿using AIVision.Repository.Services;
using AutoMapper;
using Prism.Ioc;

namespace AIVision.Repository
{
    public static class ContainerExtensions
    {
        public static void RegisterRepositoryTypes(this IContainerRegistry containerRegistry)
        {
            var config = new MapperConfiguration(cfg =>
            {
                cfg.AddProfile(new AutoMapperProfile());
            });
            IMapper mapper = config.CreateMapper();
            containerRegistry.RegisterInstance<IMapper>(mapper);

            containerRegistry.RegisterSingleton<AiVisionDbContext>();
            containerRegistry.RegisterSingleton<PLCConfigService>();
            containerRegistry.RegisterSingleton<CheckTempleteService>();
            containerRegistry.RegisterSingleton<CameraService>();
            containerRegistry.RegisterSingleton<InpsectionRecordService>();
        }
    }
}
